@model iMyRestaurent.Models.RegisterModel
@section import {
    @NoCache.Instance.Css(Url, "~/Content/account.css")
}
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "iMyRestaurant - Register";
}
<div class="landing-container">
    <div class="image-left">
    </div>
    <div class="image-right">
    </div>
    <div id="top-space">
    </div>
    <div class="logo">
    </div>
    <div id="version">
        Version 1.3.83</div>
    <div id="powered-by">
        <span>Powered by </span><span class="vendor-name">iMyVenue applications</span>
    </div>
    <div id="description">
        A major step forward in managing your restaurant and getting customers<br />
        to make table reservations from Smartphone devices or your website.
    </div>
    @using (Html.BeginForm())
    {
        <input type="hidden" id="register" value="@(Model == null ? false : Model.IsRedirect)" />
                                     
        <div class="opacity-box center-box clearfix" id="form">
            <div class="center-box" id="table-form">
                <div id="error" class="hidden">
                    @ViewBag.ErrorMessage
                </div>
                <div class="left field-title">
                    <span>Email (Login)</span>
                </div>
                <div class="left field-input" id="txt-email">
                    @Html.TextBoxFor(x => x.UserEmailID)
                </div>
                <table width="330px" cellpadding="0" cellspacing="0" class="center-box" id="table-button">
                    <tr>
                        <td width="240px" valign="bottom">
                            <input type="submit" name="submitLogin" value="" class="image-button button-register" />
                        </td>
                        <td valign="bottom">
                            <a class="button-demo image-button left" href="@Url.Action("Index", "Demo")"></a>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    }
</div>
@section footer {
    <a class="button-back image-button left" href="@Url.Action("Login", "Account")">
    </a>
}
@section script {
    <script language="javascript" type="text/javascript">
        $(window).ready(function () {
            if ($("#register").val().toLowerCase() === "true") {
                MessageBox.show({
                    message: ["Your new login ID and password has been emailed to you. Please use this ID and password to login!"],
                    buttons: {
                        ok: function () {
                            window.location = "Login";
                        }
                    }
                });
            }

            if ($.trim($("#error").text()).length > 0) {
                MessageBox.show({
                    message: [$("#error").text()],
                    buttons: {
                        ok: null
                    }
                });
            }
        });

        $(function () {
            $(".button-register").click(function () {
                if ($.trim($("input[name='UserEmailID']").val()).length === 0) {
                    MessageBox.show({
                        message: ["Your email is invalid. Please check again!"],
                        buttons: {
                            ok: null
                        }
                    });

                    return false;
                } else {
                    return true;
                }
            });
        });
    </script>
}
